<!DOCTYPE html>
<html class="no-js" lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>图书管理系统</title>
    <meta name="description" content="AppUI is a Web App Bootstrap Admin Template created by pixelcave and published on Themeforest">
    <meta name="author" content="pixelcave">
    <meta name="robots" content="noindex, nofollow">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="shortcut icon" href="../../../static/img/favicon.png">
    <link rel="apple-touch-icon" href="../../../static/img/icon57.png" sizes="57x57">
    <link rel="apple-touch-icon" href="../../../static/img/icon72.png" sizes="72x72">
    <link rel="apple-touch-icon" href="../../../static/img/icon76.png" sizes="76x76">
    <link rel="apple-touch-icon" href="../../../static/img/icon114.png" sizes="114x114">
    <link rel="apple-touch-icon" href="../../../static/img/icon120.png" sizes="120x120">
    <link rel="apple-touch-icon" href="../../../static/img/icon144.png" sizes="144x144">
    <link rel="apple-touch-icon" href="../../../static/img/icon152.png" sizes="152x152">
    <link rel="apple-touch-icon" href="../../../static/img/icon180.png" sizes="180x180">
    <link rel="stylesheet" href="../../../static/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../../static/css/plugins.css">
    <link rel="stylesheet" href="../../../static/css/main.css">
    <link rel="stylesheet" href="../../../static/css/themes.css">
    <script src="../../../static/js/vendor/modernizr-3.3.1.min.js"></script>
</head>
<body>
<div id="page-wrapper" class="page-loading">
    <div class="preloader">
        <div class="inner">
            <div class="preloader-spinner themed-background hidden-lt-ie10"></div>
            <h3 class="text-primary visible-lt-ie10"><strong>Loading..</strong></h3>
        </div>
    </div>
    <div id="page-container" class="header-fixed-top sidebar-visible-lg-full">
        <div id="sidebar">
            <div id="sidebar-brand" class="themed-background">
                <a href="" class="sidebar-title">
                    <i class="fa fa-cube"></i> <span class="sidebar-nav-mini-hide">图书管理系统</span>
                </a>
            </div>
            <div id="sidebar-scroll">
                <!-- Sidebar Content -->
                <div class="sidebar-content">
                    <!-- Sidebar Navigation -->
                    <ul class="sidebar-nav">
                        <li>
                            <a th:href="@{/index(id=${user.id})}"><i class="gi gi-compass sidebar-nav-icon"></i><span class="sidebar-nav-mini-hide">首页</span></a>
                        </li>
                        <li class="sidebar-separator">
                            <i class="fa fa-ellipsis-h"></i>
                        </li>
                        <li>
                            <a th:href="@{/book/selectAll(current=1,id=${user.id})}"><i class="fa fa-rocket sidebar-nav-icon"></i><span class="sidebar-nav-mini-hide">图书查询</span></a>
                        </li>
                        <li class=" active">
                            <a href="#" class="sidebar-nav-menu"><i class="fa fa-chevron-left sidebar-nav-indicator sidebar-nav-mini-hide"></i><i class="gi gi-airplane sidebar-nav-icon"></i><span class="sidebar-nav-mini-hide">我的借还</span></a>
                            <ul>
                                <li>
                                    <a th:href="@{/lend/selectSome(current=1,id=${user.id})}" class=" active">我要还书</a>
                                </li>
                                <li>
                                    <a th:href="@{/lend/selectAll(current=1,id=${user.id})}">借还管理</a>
                                </li>
                            </ul>
                        </li>
                        <li>
                            <a href="#" class="sidebar-nav-menu"><i class="fa fa-chevron-left sidebar-nav-indicator sidebar-nav-mini-hide"></i><i class="gi gi-more_items sidebar-nav-icon"></i><span class="sidebar-nav-mini-hide">图书挂失</span></a>
                            <ul>
                                <li>
                                    <a th:href="@{/lend/toUpdateOne(current=1,id=${user.id})}">挂失</a>
                                </li>
                                <li>
                                    <a th:href="@{/lend/toUpdateTwo(current=1,id=${user.id})}">解挂</a>
                                </li>
                            </ul>
                        </li>
                        <li>
                            <a th:href="@{/user/me(id=${user.id})}"></i><i class="fa fa-gift sidebar-nav-icon"></i><span class="sidebar-nav-mini-hide">个人信息</span></a>
                        </li>
                        <li>
                            <a th:href="@{/user/toPwd(id=${user.id})}"><i class="gi gi-inbox sidebar-nav-icon"></i><span class="sidebar-nav-mini-hide">密码修改</span></a>
                        </li>
                    </ul>
                    <!-- END Sidebar Navigation -->
                </div>
                <!-- END Sidebar Content -->
            </div>
            <!-- END Wrapper for scrolling functionality -->

            <!-- Sidebar Extra Info -->
            <div id="sidebar-extra-info" class="sidebar-content sidebar-nav-mini-hide">

                <div class="progress progress-mini push-bit">
                    <div class="progress-bar progress-bar-primary" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"></div>
                </div>
                <div class="text-center">
                    <small>Crafted with <i class="fa fa-heart text-danger"></i> by <a href="#" target="_blank">***</a></small><br>
                    <small><span>2023-12</span> &copy; <a href="#">***</a></small>
                </div>
            </div>
            <!-- END Sidebar Extra Info -->
        </div>
        <!-- END Main Sidebar -->

        <!-- Main Container -->
        <div id="main-container">

            <header class="navbar navbar-inverse navbar-fixed-top">
                <!-- Left Header Navigation -->
                <ul class="nav navbar-nav-custom">
                    <!-- Main Sidebar Toggle Button -->
                    <li>
                        <a href="javascript:void(0)" onclick="App.sidebar('toggle-sidebar');this.blur();">
                            <i class="fa fa-ellipsis-v fa-fw animation-fadeInRight" id="sidebar-toggle-mini"></i>
                            <i class="fa fa-bars fa-fw animation-fadeInRight" id="sidebar-toggle-full"></i>
                        </a>
                    </li>
                    <li class="hidden-xs animation-fadeInQuick">
                        <a href=""><strong>WELCOME</strong></a>
                    </li>
                </ul>
                <ul class="nav navbar-nav-custom pull-right">
                    <!-- User Dropdown -->
                    <li class="dropdown">
                        <a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown">
                            <img src="../../../static/img/0.jpg" alt="avatar" style="border-style: none;">
                        </a>
                        <ul class="dropdown-menu dropdown-menu-right">
                            <li class="dropdown-header">
                                <strong th:text="${user.name}"></strong>
                            </li>
                            <li>
                                <a th:href="@{/user/toPwd(id=${user.id})}" onclick="App.sidebar('toggle-sidebar-alt');">
                                    <i class="gi gi-settings fa-fw pull-right"></i>
                                    修改密码
                                </a>
                            </li>
                            <li>
                                <a th:href="@{/toLock(id=${user.id})}">
                                    <i class="gi gi-lock fa-fw pull-right"></i>
                                    锁屏
                                </a>
                            </li>
                            <li>
                                <a th:href="@{/}">
                                    <i class="fa fa-power-off fa-fw pull-right"></i>
                                    退出
                                </a>
                            </li>
                        </ul>
                    </li>
                    <!-- END User Dropdown -->
                </ul>
                <!-- END Right Header Navigation -->
            </header>
            <!-- END Header -->


            <!--main-->
            <div style="background-color:#fff;width: auto;height: 720px;padding-top: 100px;" >
                <nav aria-label="..." style="margin-left: 870px;">
                <ul class="pager">
                    共<li><a href="#" style="border-radius: 10px;margin-left: 8px;margin-right: 8px;" th:text="${page.pages}"></a></li>页
                    <li><a th:href="@{/lend/selectSome(current=${page.current}-1,id=${user.id})}" style="margin-left: 8px;">上一页</a></li>
                    <li><a href="#" style="border-radius: 10px;margin-left: 8px;margin-right: 8px;" th:text="${page.current}"></a></li>
                    <li><a th:href="@{/lend/selectSome(current=${page.current}+1,id=${user.id})}">下一页</a></li>
                </ul>
            </nav>
                <div style="padding: 20px 550px -5px">
                </div>
                <div class="panel panel-default" style="width: 90%;margin-left: 5%">
                    <div class="panel-heading" style="background-color: #fff">
                        <h3 class="panel-title">
                            全部未还图书
                        </h3>
                    </div>
<!--                    <div style="position: relative;top: 2%">-->
<!--                        <c:if test="${!empty succ}">-->
<!--                            <div class="alert alert-success alert-dismissable">-->
<!--                                <button type="button" class="close" data-dismiss="alert"-->
<!--                                        aria-hidden="true">-->
<!--                                    &times;-->
<!--                                </button>-->
<!--                                    -->
<!--                            </div>-->
<!--                        </c:if>-->
<!--                        <c:if test="${!empty error}">-->
<!--                            <div class="alert alert-danger alert-dismissable">-->
<!--                                <button type="button" class="close" data-dismiss="alert"-->
<!--                                        aria-hidden="true">-->
<!--                                    &times;-->
<!--                                </button>-->
<!--                                    -->
<!--                            </div>-->
<!--                        </c:if>-->
<!--                    </div>-->
                    <div class="panel-body">
                        <table class="table table-hover">
                            <thead>
                            <tr>
                                <th>书名</th>
                                <th>作者</th>
                                <th>出版社</th>
                                <th>语言</th>
                                <th>价格</th>
                                <th>借出日期</th>
                                <th>应还日期</th>
                                <th>图书状态</th>
                                <th>还书</th>
                                <th>续借</th>
                            </tr>
                            </thead>
                            <tbody>
                                <tr th:each="lend : ${page.records}">
                                    <td th:text="${lend.bookInfo.name}"></td>
                                    <td th:text="${lend.bookInfo.author}"></td>
                                    <td th:text="${lend.bookInfo.publish}"></td>
                                    <td th:text="${lend.bookInfo.language}"></td>
                                    <td th:text="${lend.bookInfo.price}"></td>
                                    <td th:text="${#dates.format(lend.lendDate , 'yyyy-MM-dd')}"></td>
                                    <td th:text="${#dates.format(lend.backDate , 'yyyy-MM-dd')}"></td>

                                    <!--0:：未还，1：已还，2：超期   判断不同状态显示不同按钮-->
                                    <td th:if="${lend.flag==0}">
                                        <button type="button" class="btn btn-success btn-xs">未还</button>
                                    </td>
                                    <td th:if="${lend.flag==2||lend.flag==3}">
                                        <button type="button" class="btn btn-danger btn-xs">超期</button>
                                    </td>
                                    <td th:if="${lend.lossflag==1}">
                                        <button type="button" class="btn btn-defalut btn-xs" disabled="disabled">挂失中</button>
                                    </td>
                                    <td th:if="${lend.lossflag==0}">
                                        <a th:href="@{/lend/updateFour(id=${user.id},current=${page.current},serNum=${lend.serNum},bookId=${lend.bookId})}" onclick="return guihuan()">
                                            <button type="button" class="btn btn-danger btn-xs">归还</button>
                                        </a>
                                    </td>
                                    <!--到应还日期前15天或者超期才能让用户续借-->
                                    <td th:if="${lend.lossflag==1}">
                                        <button type="button" class="btn btn-defalut btn-xs" disabled="disabled">挂失中</button>
                                    </td>
                                    <td th:if="${lend.lossflag==0}">
                                        <a th:href="@{/lend/updateFive(id=${user.id},current=${page.current},serNum=${lend.serNum})}" onclick="return xujie()">
                                            <button type="button" class="btn btn-success btn-xs">续借</button>
                                        </a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>



            </div>

        </div>
    </div>
</div>
<!-- END Main Container -->

<script src="../../../static/js/vendor/jquery-2.2.4.min.js"></script>
<script src="../../../static/js/vendor/bootstrap.min.js"></script>
<script src="../../../static/js/plugins.js"></script>
<script src="../../../static/js/app.js"></script>
<script src="../../../static/js/pages/readyDashboard.js"></script>
<script>$(function(){ ReadyDashboard.init(); });</script>
<script>
    function guihuan()
    {
        var i = confirm("是否确定归还此图书？");
        if(i == true)
        {
            alert("确定");
        }
        else
        {
            alert("取消");
        }
        return i;
    }
    function xujie()
    {
        var i = confirm("是否确定续借此图书？");
        if(i == true)
        {
            alert("确定");
        }
        else
        {
            alert("取消");
        }
        return i;
    }
</script>
</body>
</html>